<%@ page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"
	trimDirectiveWhitespaces="true"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ include file="../admin.inc.jsp"%>
<script>
	function toSubmit() {		
		var obj = $("#upload");
		var form = $("#form_modelInfo_add");
		form.submit();
	}
	function callback(success, msg) {
		if (success) {
			alertMsg.info(msg);
			navTab.closeCurrentTab();		
			navTab.reload("", {
				lastTabId : ""
			});
		}else{
			alertMsg.warn(msg);
		}
	}
	
	function countryCode_onchange(){
		var countryCode = $("#countryCode").val();
		if(countryCode!=null){
			$.post('${webContextPath}/admin/modelInfo/getProvince',{"countryCode":countryCode},
				function(data) {
					$("#provinceCode").empty(); 
					$("#cityCode").empty();
					$("#provinceCode").append("<option value=''>"+""+"</option>");
			        var provinceList=data.data.provinceList;
			        if(provinceList!=null&&provinceList!=''){
			        	for(var i=0;i < provinceList.length;i++){
				        	$("#provinceCode").append("<option value='"+provinceList[i].code+"'>"+provinceList[i].name+"</option>");
			        	}
			        } else {
			        	$("#provinceCode").val(null);
			        }
			  })
		}
	   }
	
	function provinceCode_onchange(){
		var provinceCode = $("#provinceCode").val();
		if(provinceCode!=null){
			$.post('${webContextPath}/admin/modelInfo/getCity',{"provinceCode":provinceCode},
				function(data) {
					$("#cityCode").empty();
					$("#cityCode").append("<option value=''>"+""+"</option>");
			        var cityList=data.data.cityList;
			        if(cityList!=null&&cityList!=''){
			        	for(var i=0;i < cityList.length;i++){
				        	$("#cityCode").append("<option value='"+cityList[i].code+"'>"+cityList[i].name+"</option>");
			        	}
			        } else {
			        	$("#cityCode").val(null);
			        }
			  })
		}
	   }

</script>
<div class="pageContent">
	<s:form name="myForm" id="form_modelInfo_add" action="/admin/modelInfo/add"
		method="POST" enctype="multipart/form-data" target="hidden_frame">
		<div class="pageFormContent" layoutH="58">
			<!-- <p>
				<label>模特编号：</label> 
				<input type="text" name="modelInfo.modelCode" >
			</p> -->
			
			<p>
				<label>姓名：</label>
				<input type="text" name="modelInfo.name" >
			</p>
			
			<p>
				<label>性别：</label> 
				<select id = "mateType" name="modelInfo.sex" class="required" >
					<option value="01" >男</option>
					<option value="02" >女</option>
				</select>
			</p>
			
			<p>
				<label>年龄：</label>
				<input type="text" name="modelInfo.age" >
			</p>
			
			<p>
				<label>年龄层：</label>
				<select id="ageGroup" name="modelInfo.ageGroup" >
					<c:forEach var="item1" items="${ageGroupList}">
		            	<option value="${item1.configValue}" >${item1.description}</option>
		            </c:forEach>
				</select>
			</p>
			
			<p>
				<label>封面：</label> 
				 <input type="file" name="coverImage"
					id="coverImage" />
			</p>
			
			<p>
				<label>价格：</label>
				<input type="text" name="modelInfo.price" >
			</p>
			
			<p>
				<label>国籍：</label>
				<select id="countryCode" name="modelInfo.countryCode"  onchange="countryCode_onchange()">
					<c:forEach var="item1" items="${countryList}">
		            	<option value="${item1.code}" >${item1.name}</option>
		            </c:forEach>
				</select>
			</p>
			
			<p>
				<label>省份：</label>
				<select id="provinceCode" name="modelInfo.provinceCode"  onchange="provinceCode_onchange()">
					<c:forEach var="item1" items="${provinceList}">
		            	<option value="${item1.code}" >${item1.name}</option>
		            </c:forEach>
				</select>
			</p>
			
			<p>
				<label>城市：</label>
				<select id="cityCode" name="modelInfo.cityCode" >
					<c:forEach var="item1" items="${cityList}">
		            	<option value="${item1.code}" >${item1.name}</option>
		            </c:forEach>
				</select>
			</p>

			<p>
				<label>身高：</label>
				<input type="text" name="modelInfo.height" >
			</p>
			
			<p>
				<label>体重：</label> 
				<input type="text" name="modelInfo.weight" >
			</p>
			
			<p>
				<label>鞋码：</label> 
				<input type="text" name="modelInfo.shoeSize" >
			</p>
			
			<p>
				<label>胸围码：</label> 
				<input type="text" name="modelInfo.bustSize" >
			</p>
			
			<p>
				<label>臀围码：</label> 
				<input type="text" name="modelInfo.hiplineSize" >
			</p>
			
			<p>
				<label>腰围码：</label> 
				<input type="text" name="modelInfo.waistSize" >
			</p>
			
			<p>
				<label>罩杯码：</label> 
				<input type="text" name="modelInfo.cupSize" >
			</p>
			
			<p>
				<label>发色：</label>
				<select id="hairColorCode" name="modelInfo.hairColorCode" >
					<c:forEach var="item1" items="${hairColorList}">
		            	<option value="${item1.configValue}" >${item1.description}</option>
		            </c:forEach>
				</select>
			</p>
			
			<p>
				<label>肤色：</label>
				<select id="skinColorCode" name="modelInfo.skinColorCode" >
					<c:forEach var="item1" items="${skinColorList}">
		            	<option value="${item1.configValue}" >${item1.description}</option>
		            </c:forEach>
				</select>
			</p>
			
			<p>
				<label>人种：</label>
				<select id="raceCode" name="modelInfo.raceCode" >
					<c:forEach var="item1" items="${raceList}">
		            	<option value="${item1.configValue}" >${item1.description}</option>
		            </c:forEach>
				</select>
			</p>
			
			<p>
				<label>眼睛：</label>
				<select id="eyeCode" name="modelInfo.eyeCode" >
					<c:forEach var="item1" items="${eyeList}">
		            	<option value="${item1.configValue}" >${item1.description}</option>
		            </c:forEach>
				</select>
			</p>
			
			<p>
				<label>臂长：</label> 
				<input type="text" name="modelInfo.armLength" >
			</p>
			
			<%-- <p>
				<label>臂围：</label> 
				<input type="text" name="modelInfo.armSize"  value="${modelInfo.armSize }">
			</p> --%>
			
			<p>
				<label>臂围码：</label> 
				<input type="text" name="modelInfo.upArmSize" >
			</p>
			
			<p>
				<label>腿围码：</label> 
				<input type="text" name="modelInfo.legSize" >
			</p>
			
			<p>
				<label>大腿围码：</label> 
				<input type="text" name="modelInfo.thighSize" >
			</p>
			
			<p>
				<label>颈长：</label>
				<input type="text" name="modelInfo.neckLength" >
			</p>
			
			<p>
				<label>颈围：</label>
				<input type="text" name="modelInfo.neckSize" >
			</p>
			
			<p>
				<label>头围：</label>
				<input type="text" name="modelInfo.headSize" >
			</p>
			
			<p>
				<label>领围：</label>
				<input type="text" name="modelInfo.collarSize" >
			</p>
			
			<p>
				<label>肩宽：</label>
				<input type="text" name="modelInfo.shoulderSize" >
			</p>
			
			<p>
				<label>手长：</label>
				<input type="text" name="modelInfo.annLength" >
			</p>
			
			<p>
				<label>袖长：</label>
				<input type="text" name="modelInfo.sleeveLength" >
			</p>
			
			<p>
				<label>身长：</label>
				<input type="text" name="modelInfo.centerBack" >
			</p>
			
			<p>
				<label>上围：</label>
				<input type="text" name="modelInfo.chestSize" >
			</p>
			
			<p>
				<label>下胸围：</label>
				<input type="text" name="modelInfo.underbustSize" >
			</p>
			
			<!-- <p>
				<label>低腰围：</label>
				<input type="text" name="modelInfo.highHipSize" >
			</p> -->
			
			<p>
				<label>中围：</label>
				<input type="text" name="modelInfo.midHipSize" >
			</p>
			
			<p>
				<label>下围：</label>
				<input type="text" name="modelInfo.lowHipSize" >
			</p>
			
			<p>
				<label>腕围：</label>
				<input type="text" name="modelInfo.wristSize" >
			</p>
			
			<p>
				<label>裤外长：</label>
				<input type="text" name="modelInfo.outseamSize" >
			</p>
			
			<p>
				<label>裤内长：</label>
				<input type="text" name="modelInfo.inseamSize" >
			</p>
			
			<p>
				<label>小腿围：</label>
				<input type="text" name="modelInfo.calfSize" >
			</p>
			
			<!-- <p>
				<label>足踝：</label>
				<input type="text" name="modelInfo.ankleSize" >
			</p>
			 -->
			<p>
				<label>西装外套码：</label>
				<input type="text" name="modelInfo.suitSizes" >
			</p>
			
			<p>
				<label>所属公司：</label> 
				<select id = "type" name="modelInfo.companyId" class="required">
					<c:forEach var="item" items="${companyList}">
		            	<option value="${item.id}"  >${item.name}</option>
		            </c:forEach>
				</select> 
			</p>
			<p>
				<label>上架时间</label>	
				<input id="beginTime"  class="Wdate" type="text"  name="modelInfo.beginTime" 
				onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" readonly="true">
				<a class="inputDateButton"  href="javascript:;">选择</a>
			</p>
			<p>
				<label>下架时间：</label>
				 <input id="endTime"  class="Wdate" type="text"  name="modelInfo.endTime" 
				onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" readonly="true">
				<a class="inputDateButton"  href="javascript:;">选择</a>
			</p>
			<p class="nowrap">
				<label>工作履历：</label> 
				<textarea style="height:100px;width:253px;"  name="modelInfo.richResume" ></textarea>
			</p>
			
			<p class="nowrap">
				<label>备注：</label> 
				<textarea style="height:100px;width:253px;"  name="modelInfo.remark" ></textarea>
			</p>
			
			<p  class="nowrap">
				<label>风格：</label>
			</p>
			
			<p style="margin-left:58px;margin-bottom:150px;">
				<c:forEach var="style" items="${styleList}">
					<label style="text-align:left;"><input type="checkbox" name="style" value="${style.configValue}"  />${style.description}</label>
				</c:forEach>
			</p>
			
			<p  class="nowrap">
				<label>经验：</label>
			</p>
			
			<p style="margin-left:58px;">
				<c:forEach var="exper" items="${experList}">
					<label style="text-align:left;"><input type="checkbox" name="exper" value="${exper.configValue}"  />${exper.description}</label>
				</c:forEach>
			</p>
			
		</div>
	</s:form>
	<div class="formBar">
		<ul>
			<li><div class="button">
					<div class="buttonContent">
						<button onclick="toSubmit()" type="button">确定</button>
					</div>
				</div></li>
			<li><div class="button">
					<div class="buttonContent">
						<button type="button" class="close">关闭</button>
					</div>
				</div></li>
		</ul>
	</div>
</div>
<iframe name='hidden_frame' id="hidden_frame" style='display: none'></iframe>